<div class="index-container w1024 bc">
    <div class="doctor-form">
        <h1 class="f24 mt30 mb20 tc">医师申请表</h1>
        <div class="prev-title f14 pl20 pr10 clearfix"><span class="fl">请填写你的认证资料(医生资格证书)</span><span class="fr mr30">为何申请服务类型？</span></div>
        <p class="form-msg pl20 pr20 clearfix"><span class="fl">您的个人隐私信息均不会被公开，只用于认证医师资格及核实医生本人信息。</span><span class="fr">所填信息都会有51天使平台认证</span></p>
        <p class="form-msg pl20 pr20">请尽量填写完所有内容，加快申请审核进度。</p>
        <div class="status-box p20">
            <div class="clearfix">
                <div class="fl">
                    <?php $consult_types = isset($response['doctors']) && $response['doctors'] && isset($response['doctors']['ConsultType'])
                        ? explode(',', trim($response['doctors']['ConsultType']))
                        : array() ?>
                    <?php $server_types = isset($response['doctors']) && $response['doctors'] && isset($response['doctors']['ServerType'])
                        ? explode(',', trim($response['doctors']['ServerType']))
                        : array() ?>
                    <p class="mt10">咨询类
                        <?php if(isset($GLOBALS['consult_role'])): ?>
                            <?php foreach($GLOBALS['consult_role'] as $k=>$role):?>
                                <input type="checkbox" name="role" value="<?php echo $k; ?>"
                                       class="checkbox-01 ml10 mr10 pr"
                                        <?php if(in_array($k, $consult_types)):?> checked<?php endif;?>/><?php echo $role;?>
                            <?php endforeach;?>
                        <?php endif;?>
                        <span id="checkrole"></span>
                    </p>
                    <p class="mt10">服务类
                        <?php if(isset($GLOBALS['server_type'])): ?>
                            <?php foreach($GLOBALS['server_type'] as $k=>$server):?>
                                <input type="checkbox" name="server_type" value="<?php echo $k; ?>"
                                       class="checkbox-01 ml10 mr10 pr"
                                        <?php if(in_array($k, $server_types)):?> checked<?php endif;?>/><?php echo $server;?>
                            <?php endforeach;?>
                        <?php endif;?>
                        <span id="checkserver"></span>
                    </p>
                </div>
                <p class="fr"><span class="fl">注：</span><span class="block ml25">咨询类可以多选，建议与自己能力相匹配，我们会根据您所提供的资料最终碇，可根据下表格选择咨询级别。</span></p>
            </div>
            <div class="msg">
                <p>所填信息都会有51天使平台认证</p>
                <p>其他个人资料如教育信息，个人介绍等可在认证完成后在个人中心的个人资料中完善。</p>
            </div>
        </div>
        <div class="mt20 tc">
            <a href="/center/doctors/app_md" class="button-01 mr20">上一步</a>
            <input value="下一步" type="button" class="button-01 mr20" onclick=" return last_submit()" >
        </div>
    </div>
</div>
<script>
    function last_submit(){
        var role_str = '';
        $("input[name=role]:checked").each(function(){
            role_str +=$(this).val()+'_';
        });
        var server_str = '';
        $("input[name=server_type]:checked").each(function(){
            server_str +=$(this).val()+'_';
        });
        if(role_str =='') {
            $("#checkrole").html('请选择咨询类级别');
            return false;
        }
        if(server_str =='') {
            $("#checkserver").html('请选择服务类级别');
            return false;
        }
        var params = 'app_fmt=json&app_page=null&role='+role_str+'&server_type='+server_str;
        Ajax.call('/center/doctors/do_app_last', params, function (data) {
            data = eval('('+data+')');
            if(data.code ==0) {
                location.href='/center/doctors/app_confirm';
            }else {
                alert(data.msg);
            }
        });
    }
</script>